class GroupsAndEdgeTypes < ActiveRecord::Migration
  def self.up
    create_table :groups, :force => true do |t|
      t.column :community_id, :integer, :null => false
      t.column :name, :string,  :limit => 100, :default => "", :null => false
      t.column :group_type, :string,  :limit => 100, :default => "", :null => false
    end
    create_table(:groups_nodes, :force => true, :id => false) do |t|
      t.column :group_id, :integer, :null => false
      t.column :node_id, :integer, :null => false
    end
    add_column :edges, :edge_type, :string, :limit => 100, :default => "", :null => true
  end

  def self.down
    drop_table :groups
    drop_table :groups_nodes
    remove_column :edges, :edge_type
  end

end
